package com.woniuxy.conf;

import org.springframework.amqp.core.*;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;


/**
 * @Author: 曾令忠
 * @Description: 此配置文件的作用：1.创建消息队列和交换机；2.绑定消息队列和交换机
 * @Date: 2020/7/4 0004-下午 3:55
 */
@Configuration
public class RabbitMqConf {

    /**
     * 应用解耦
     */
    @Bean
    public Queue rpcQueueB(){
        return  new Queue("rpc_queue_b");
    }
    @Bean
    public FanoutExchange rpcChangeB(){
        return new FanoutExchange("rpc_exchange_b");
    }
    @Bean
    public Binding bindingrpcQueueBandrpcChangeB(Queue rpcQueueb, FanoutExchange rpcChangeB){
        return BindingBuilder.bind(rpcQueueb).to(rpcChangeB);
    }

}
